All Questions
Tagged with kshshell-script
230 questions
0votes
0answers
22views
Shell: redirecting output to /dev/tty and another file in a script? Not having to retype ending?
How do I accomplish this command to redirect command output to multiple files, without retyping the later A=1>&/dev/tty 1>&${TMP}/lastcmdout every time? I want to see output on the ...
0votes
0answers
33views
Can't use combination of parentheses and variables in scripts [duplicate]
I have problems with replacing parentheses in combination with variables, in ssh. For instance, replacing (hello123blablabla) with (hello). So, it replaces all together, and parentheses as well, at ...
-4votes
1answer
58views
how to check if a large script is only using full paths for the used cmd inside it?
to make a script more secure, we would need to confirm that used cmds, eg.: "/usr/bin/chown" instead of just "chown".
0votes
1answer
88views
Cut command failing
We have a ksh Script that is suppose to give the output as last day of the month but when ever we run it we get the below error: cut: fields are numbered from 1 Try ‘cut —help’ for more information, ...
0votes
0answers
59views
Concatenating 2 environmental variables in a ksh script [duplicate]
I have a storage.src file with the following 2 environmental variables exported export FIRST="HelloHelloHello" export SECOND="World" I have a .sh file as follows #!/bin/ksh . /...
0votes
1answer
104views
Bash Shebang scripts with a .ksh extention
I have inherited shell scripts that have a bash shebang...but for some reason have a .ksh extension. The creator of these scripts is no longer here and I cant find any reason in Google. Why would he ...
0votes
1answer
177views
How to stop the while loop after four hours in shell script, if the file not found?
I am working on the ksh script where I am getting the file from the sftp server & copying to local & checking if the file is available there or not. I am running this on loop if the file is ...
0votes
2answers
338views
How to check the headers between 2 CSV files in unix?
File1 - filename.csv File2 - filename.csv I wanted to compare the headers between these 2 files in linux using a ksh script. case 1:- Say, the header of file1 is INPUT --> NAME,UNIT CODE, VAR ...
-2votes
1answer
244views
"for" loop is not executing on the remote server using SSH
The below "for" loop works locally on the same server. But when triggered through "ssh" protocol on remote servers, the output is not received. Please, can anyone suggest how to ...
2votes
1answer
465views
if var='value' then in Zsh: Is it really a valid syntax without semicolon?
The following code works on Zsh 5.8 that I tried, despite the missing semicolon. But is it really a valid Zsh syntax? #!/bin/zsh if var='value' then echo 'then' fi Without an assignation that ...
0votes
1answer
373views
Writing a ksh-script with a predefined time-out
My OS is AIX (7.2) and my shell is ksh88 (preferably) or ksh93, if necessary. I want to write a script that sets some maximum timer for its execution. If it manages to finish its task within this time ...
0votes
0answers
210views
Having problem using uuencode in script
I am using below command and it works: uuencode stats.txt stats.txt | mailx -s "users" [email protected] But when I put same command inside my shell script, it does not work. I dont have email. ...
3votes
1answer
416views
Why is "${1-"$var"}" (option 6 down below) not mentioned in POSIX?
The only reference I could find in the spec is this: It would be desirable to include the statement "The characters from an enclosed "${" to the matching '}' shall not be affected by ...
0votes
1answer
161views
Issue - infinite loop using while on ksh script
I'm writting a scsript to automate some check at work & i have trouble on only 1 standing issue which is the script never ending. It do the all task over & over. There are 2 while loop & ...
0votes
1answer
268views
how to check for specific string in a file named abc.txt and write that missing string to another file (xyz.txt) using a shell script?
For example, generally I need to check for 5 strings. (Note : the strings are in file format .txt) file1.txt file2.txt file3.txt file4.txt file5.txt but there are 3 strings in abc.txt file1.txt ...